package com.dmooo.yxmmerchant.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.common.glide.GlideUtils;
import com.dmooo.yxmmerchant.R;
import com.dmooo.yxmmerchant.common.Config;
import com.dmooo.yxmmerchant.domain.BannerListBean;

import java.util.List;

public class BannerListAdapter extends BaseQuickAdapter<BannerListBean.BannerItem,BaseViewHolder> {
    public BannerListAdapter(int layoutResId, @Nullable List<BannerListBean.BannerItem> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BannerListBean.BannerItem item) {
        GlideUtils.showImageView(mContext,mContext.getResources().getDrawable(R.mipmap.defaultpicture_classify),Config.APP_INTERFACE_BASE_URL+item.img, (ImageView) helper.getView(R.id.img));
        helper.setText(R.id.txt_title,item.title);
        helper.setText(R.id.txt_sort,item.sort);
        helper.addOnClickListener(R.id.img_edit).addOnClickListener(R.id.img_del);
    }
}
